<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-1.11.1.min.js"></script>
    <script src="js/gVerify.js"></script>
    <style>
        img{
            width: 60px;
            height: 100px;
        }
    </style>
</head>
<body>
<!--<div id="v_container" style="width: 80px;height: 40px;">换一张</div>-->
<!--<input type="text" id="code_input" value="" placeholder="请输入验证码"/><button id="my_button">验证</button>-->
<img src="" alt="">
<input type="file">
<button></button>
</body>
</html>

<script>
    var imgIn = document.querySelector("input");
    var oImg = document.querySelector("img");
    imgIn.onchange = function () {
        var fileReader = new FileReader;
        console.log(fileReader);
        fileReader.readAsDataURL(this.files[0]);
        console.log(fileReader.readAsDataURL(this.files[0]));
        fileReader.onload = function (ev) {
            oImg.src = ev.target.result;
        }
    }
</script>
<!--<script>-->
    <!--var verifyCode = new GVerify("v_container");-->
    <!--document.getElementById("my_button").onclick = function(){-->
        <!--var res = verifyCode.validate(document.getElementById("code_input").value);-->
        <!--if(res){-->
            <!--alert("验证正确");-->
        <!--}else{-->
            <!--alert("验证码错误");-->
        <!--}-->
    <!--}-->
<!--</script>-->